/*
 * User_typedefs.h
 *
 *  Created on: 2020年9月9日
 *      Author: ZhangJianCe
 */

#ifndef USER_TYPEDEFS_H_
#define USER_TYPEDEFS_H_
#include "stdbool.h"

typedef enum
{
	False = 0,
	True = 1
} Bool_t;

typedef enum
{
	Local_Task_t = 0,
	Calibration_Task_t = 1,
	Diagnostic_Task_t = 2
} Tast_Type_t;


typedef enum
{
	Timer_1us = 0,
	Timer_10us = 1,
	Timer_100us = 2,
	Timer_1ms = 3,
	Timer_10ms = 4,
	Timer_100ms = 5
} Timer_Type_t;

typedef enum
{
	eTimer_channel0 = 0,
	eTimer_channel1 = 1,
	eTimer_channel2 = 2,
	eTimer_channel3 = 3,
	eTimer_channel4 = 4,
	eTimer_channel5 = 5
} ETimer_Channel_t;

typedef enum
{
	Cap_channel0 = 0,
	Cap_channel1 = 1,
	Cap_channel2 = 2,
	Cap_channel3 = 3
} ETimer_Cap_Channel_t;

typedef enum
{
	GPIO_LOW = 0,
	GPIO_HIGH = 1
} GPIO_IN_Status_t;


typedef enum
{
	OD_Disable = 0,
	OD_Enable = 1
} OD_Enable_t;

typedef enum
{
	PWMIN_0 = 0,
	PWMIN_1 = 1,
	PWMIN_2 = 2,
	PWMIN_3 = 3,
	ALL_PWMIN = 0xFF
} PWMIN_Sub_x;


typedef enum
{
	PWM_Sub_0 = 0,
	PWM_Sub_1 = 1,
	PWM_Sub_2 = 2,
	PWM_Sub_3 = 3,
	PWM_Sub_4 = 4,
	PWM_Sub_5= 5,
	PWM_Sub_6 = 6,
	PWM_Sub_7= 7,
	PWM_Sub_8 = 8,
	PWM_Sub_9 = 9,
	PWM_Sub_10 = 10,
	PWM_Sub_11 = 11,
	ALL_PWM_Sub = 0xFF
} PWMOUT_Sub_x;

typedef enum
{
	PULL_OFF = 0,
	PULL_UP = 1,
	PULL_DOWN = 2
} DO_PULL_t;

typedef enum
{
	OUT_DISABLE = 0,
	OUT_ENABLE = 1
} DO_OUT_ENABLE_t;

typedef enum
{
	OUT_LOW = 0,
	OUT_HIGH = 1
} DO_OUT_CMD_t;

typedef enum
{
	DI_LOW = 0,
	DI_HIGH = 1,
	DI_ERROR = 2
} DI_INPUT_Status_t;

typedef enum
{
	MB0 = 0,
	MB1 = 1,
	MB2 = 2,
	MB3 = 3,
	MB4 = 4,
	MB5 = 5,
	MB6 = 6,
	MB7 = 7,
	MB8 = 8,
	MB9 = 9,
	MB10 = 10,
	MB11 = 11,
	MB12 = 12,
	MB13 = 13,
	MB14 = 14,
	MB15 = 15,
	MB16 = 16,
	MB17 = 17,
	MB18 = 18,
	MB19 = 19,
	MB20 = 20,
	MB21 = 21,
	MB22 = 22,
	MB23 = 23,
	MB24 = 24,
	MB25 = 25,
	MB26 = 26,
	MB27 = 27,
	MB28 = 28,
	MB29 = 29,
	MB30 = 30,
	MB31 = 31,
	MB32 = 32,
	MB33 = 33,
	MB34 = 34,
	MB35 = 35,
	MB36 = 36,
	MB37 = 37,
	MB38 = 38,
	MB39 = 39,
	MB40 = 40,
	MB41 = 41,
	MB42 = 42,
	MB43 = 43,
	MB44 = 44,
	MB45 = 45,
	MB46 = 46,
	MB47 = 47,
	MB48 = 48,
	MB49 = 49,
	MB50 = 50,
	MB51 = 51,
	MB52 = 52,
	MB53 = 53,
	MB54 = 54,
	MB55 = 55,
	MB56 = 56,
	MB57 = 57,
	MB58 = 58,
	MB59 = 59,
	MB60 = 60,
	MB61 = 61,
	MB62 = 62,
	MB63 = 63,
	ALL_MB = 0xff
} CAN_MB_NUM_t;

typedef enum
{
	CAN_RX = 0,
	CAN_TX = 1
}MB_TR_Type_t;

typedef enum
{
	Standard_ID = 0,
	Extended_Id = 1
}MB_IDE_t;

typedef enum
{
	Normal_Frame = 0,
	Remote_Frame = 1
}MB_RMT_t;

typedef enum
{
	STD_Frame_Only = 0,
	EXT_Fram_Only = 1,
	STD_AND_RMT_Frame = 2,
	EXT_AND_RMT_Frame = 3,
/*If you do not need to specify the frame type separately,
 * the settings in config.h will be used,
 * please set the frame type to: Global Config Frame*/
	Use_Global_Config = 0xff
}Fram_Type_t;

typedef enum
{
	Ready_To_Transmit = 0,
	Under_Transmitting = 1
}CAN_Transmit_Status_t;

typedef enum
{
	Transmit_Disable = 0,
	Transmit_Enable = 1
}CAN_TX_Flag_t;


typedef enum
{
	Inactivate_MsgBox = 0,
	Receive_Activate_MsgBox = 4,
	Send_Inactivate_MsgBox = 8,
	MsgBox_Send = 12
}MB_Code_Cmd_t;


typedef enum
{
	LIN0 = 0,
	LIN1 = 1
} LIN_NUM_t;


typedef enum
{
	LIN_Slaver_Mode = 0,
	LIN_Master_Mode = 1
} LIN_Mode_t;


typedef enum
{
	SPI_0_0 = 0,
	SPI_0_1 = 1,
	SPI_1_0 = 2,
	SPI_1_1 = 3
}SPI_MODE_t;


#endif /* USER_TYPEDEFS_H_ */
